-
Notifications
You must be signed in to change notification settings - Fork 910
Support AutoGeneratedTimestamp and UpdateBehavior annotation in nested objects #6109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
66731de
to
e719423
Compare
…oDbUpdateBehavior on attributes within nested objects
eed3945
to
e2225c5
Compare
|
Please run the checkstyle plugin on When I do it by runing the following command
|
The test coverage checklist is not complete, could you comment on the test that aren't run to validate they are not required for this change? |
Description
Added support for @DynamoDbAutoGeneratedTimestampAttribute and @DynamoDbUpdateBehavior on attributes within nested objects. The @DynamoDbUpdateBehavior annotation will only take effect for nested attributes when using IgnoreNullsMode.SCALAR_ONLY.
Motivation and Context
@DynamoDbUpdateBehavior and @DynamoDbAutoGeneratedTimestampAttribute to work on nested objects too.
Modifications
The AutoGeneratedTimestampRecordExtension has been enhanced to support detection of the timestamp annotation on nested objects. Depending on the operation and the IgnoreNullsMode setting, nested attributes may either be treated as complete maps or flattened using the NESTED_ATTR_UPDATE convention (handled in transformItemToMapForUpdateExpression within UpdateItemOperation). Both scenarios are now supported, and the same generated timestamp is applied consistently across top-level and nested fields.
In parallel, the handling of the IgnoreNullsMode parameter within update requests was reviewed. As a result, UpdateExpressionUtils has been updated to evaluate the @DynamoDbUpdateBehavior annotation only when IgnoreNullsMode.SCALAR_ONLY is used, targeting flattened nested attributes identified via NESTED_ATTR_UPDATE.
When applied to a list of nested objects, the annotation is not supported, as individual elements cannot be updated — the entire list is replaced during an update operation.
Testing
Existing tests were updated, and new tests were added to validate the extended functionality.
Screenshots (if appropriate)
Types of changes
Checklist
mvn install
succeedsscripts/new-change
script and following the instructions. Commit the new file created by the script in.changes/next-release
with your changes.License
Test Coverage Checklist